public class DummyCommunication implements Runnable {

	RopeState rs;

	public DummyCommunication(RopeState rs) {
		this.rs = rs;
	}

	public void run() {
		
		rs.setMyForce(200);
		rs.setGameState(RopeState.COUNTDOWN);
		
		while (rs.getRopePosition() < 1000 && rs.getRopePosition() > -1000) {

			rs.setMyForce(Math.abs(rs.getMyForce() + (int)(Math.random()*10-7)));
			rs.setOpponentForce(Math.abs(rs.getOpponentForce() + (int)(Math.random()*10-4)));
			rs.setRopeForce(rs.getOpponentForce() - rs.getMyForce());
			rs.setRopePosition(rs.getRopePosition() + (rs.getRopeForce() / 10));
			
			try {
				Thread.sleep(500); 
			}
			catch(InterruptedException e) { }
			
		}

	}
	
}